package com.sjyang.demo;

import lombok.extern.slf4j.Slf4j;
import redis.clients.jedis.Jedis;

/**
 * @author 杨赛军本地账户
 * @date 2024/8/18 20:52
 */
@Slf4j
public class JedisDemo {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("192.168.247.128",6379);
        jedis.auth("ak514428");
        System.out.println("连接成功");
        System.out.println("redis ping retvalue:{}" + jedis.ping());
        jedis.set("k1","jedis");
        System.out.println("k1 value:{}" + jedis.get("k1"));
        fiveType(jedis);
    }

    static void fiveType(Jedis jedis) {
        jedis.lpush("list", "k1", "k2", "k3", "k4", "k5", "k6");
    }
}
